package com.itheima.Study;

//求1-200之间偶数的和;
public class Forxunhuan01 {
    public static void main(String[] args) {
        // 求和需先定义变量sum
        int sum = 0;
        for (int i = 1; i <= 200; i++) {
            //判断奇数偶数
            if (i % 2 == 0) {
                sum += i;
            }
        }
        System.out.println("1-200之间偶数的和为:" + sum);
    }
}
